import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;

/**
 * @Author：徐志荣
 * @Date：2023/5/22 11:25
 */
//下拉框处理
public class Test7 {
    public static void main(String[] args) {
        WebDriver webDriver = new ChromeDriver();
        webDriver.get("http://localhost:63342/_20230512_TestCode/src/main/html/test03.html?_ijt=kp3bpv8v72sudc2ku598ermdc5&_ij_reload=RELOAD_ON_SAVE");
        WebElement element = webDriver.findElement(By.cssSelector("#ShippingMethod"));
        Select select = new Select(element);
        //下标从0开始
      //  select.selectByIndex(3);

        //通过value
        select.selectByValue("12.51");


    }
}
